import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import local_set from '@dfeidao/atom-web/local/set';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
import storage_get from '@dfeidao/atom-web/storage/get';

import _show from '@dfeidao/atom-web/ui/show';
import P02 from './P02';

// 新增弹窗显示
export default async function a001(fd: IFeidaoAiBrowserComponent, args: { client_type: string, group_number: string }) {
	const prid = storage_get('productid');
	local_set(fd, 'client_type', args.client_type);
	local_set(fd, 'group_number', args.group_number);
	// debugger;
	const res1 = await nodejs<{ dataArray: Array<{ group_number: string }> }>('function-definition/zj-000001/s003', { filter: { productid: prid, client_type: args.client_type } });
	render(fd, res1, P02, 'P02', 'inner');
	const group_number = args.group_number;
	if (!group_number) {
		fd.data.node.querySelector<HTMLSelectElement>('[data-feidao-id="group_number"]').value = '未分组';
	} else {
		fd.data.node.querySelector<HTMLSelectElement>('[data-feidao-id="group_number"]').value = group_number;
	}
	_show(fd.data.node);


}
